<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function overAverage(arr) {
            var average = arr.reduce((s, i) => s + i, 0) / arr.length
            // console.log(average)
            var sum = 0
            arr.forEach(item => {
                if (item > average) {
                    sum += 1
                }
            })
            return sum
        }
        var arr = [99, 78, 65,58,72,69,81,88,54,90]
        
        console.log(overAverage(arr))
    </script>
</body>
</html>